﻿<UserControl x:Class="WiiChuckDemo.WiiChuckView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="406" d:DesignWidth="323" xmlns:my="clr-namespace:WiiChuckDemo">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <StackPanel>
            <TextBlock FontWeight="Bold" Text="Acceleration X" />
            <my:NumericSeriesView x:Name="numericSeriesView1" Margin="3" DataContext="{Binding AccelerationX}" />
            <TextBlock FontWeight="Bold" Text="Acceleration Y" />
            <my:NumericSeriesView x:Name="numericSeriesView2" Margin="3" DataContext="{Binding AccelerationY}" />
            <TextBlock FontWeight="Bold" Text="Acceleration Z" />
            <my:NumericSeriesView x:Name="numericSeriesView3" Margin="3" DataContext="{Binding AccelerationZ}" />
          
        </StackPanel>

        <StackPanel Grid.Column="1">
            <TextBlock FontWeight="Bold" Text="Acceleration X" />
            <my:NumericSeriesView x:Name="numericSeriesView4" Margin="3" DataContext="{Binding AccelerationXGs}" />
            <TextBlock FontWeight="Bold" Text="Acceleration Y" />
            <my:NumericSeriesView x:Name="numericSeriesView5" Margin="3" DataContext="{Binding AccelerationYGs}" />
            <TextBlock FontWeight="Bold" Text="Acceleration Z" />
            <my:NumericSeriesView x:Name="numericSeriesView6" Margin="3" DataContext="{Binding AccelerationZGs}" />

        </StackPanel>

        <my:ModelVisualizer Grid.Column="2" Grid.RowSpan="3"></my:ModelVisualizer>


        <Grid Grid.Column="2" Margin="4">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <TextBlock Text="Vector sum:" Margin="0,0,6,0" />
            <TextBlock Grid.Column="1" Text="{Binding AccelerationLength, StringFormat=F2}" />
            <TextBlock Grid.Row="1" Text="Roll:" Margin="0,0,6,0" />
            <TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Roll, StringFormat=F2}" />
            <TextBlock Grid.Row="2" Text="Pitch:" Margin="0,0,6,0" />
            <TextBlock Grid.Row="2" Grid.Column="1" Text="{Binding Pitch, StringFormat=F2}" />
        </Grid>
        
        <Grid Margin="3" Grid.ColumnSpan="2" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <TextBox  IsReadOnly="True" x:Name="logTextBox" Height="80" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"></TextBox>

            <StackPanel Grid.Row="1" Orientation="Horizontal">
                <Button Click="ButtonSnapshot_Click" Padding="4,2">Snapshot</Button>
            </StackPanel>
        </Grid>
    </Grid>
    
</UserControl>
